<template>
	<view :style="{'background-color':pageBg}"
		style="float: left;width: 100%;min-height: 100%;" class=" css-theme" :class="[cueTheme]">

		<view style="margin-top: 60rpx;width: 90%;font-size: 26rpx;margin-left: 5%;" >
			<rich-text type="text" :nodes="content"></rich-text>
		</view>
	</view>
</template>

<script>
	var _self;
	var graceRichText = require("store/richText.js");
	export default {

		data() {
			return {
				content: '',
				type: 0,
				user:[]
			}
		},
		onLoad(options) {
			_self = this;
			this.type = options.type
			
			uni.setNavigationBarTitle({
				title: '会员服务协议'
			})
			

		},
		onShow() {
			uni.getStorage({
				key: 'user',
				success: function(res) {
					if (res.data) {
						_self.user = res.data
						setTimeout(function() {
							_self.getCommonInfo()
						}, 200);
					}
				},
				fail: function(e) {
					uni.navigateTo({
						url: '../login/login'
					});
				}
			})
		
		},
		methods: {
			getCommonInfo() {
				var data = {
					userId: _self.user.id
				}
				this.$api.commonInfo(data).then((res) => {
					var resData = res;
					
					if (resData.code == "200") {
						_self.content = graceRichText.format(resData.data[0].remark);
					}
				})
			
			},
			

		}
	}
</script>

<style lang="scss" scoped>
	page {
		height: 100%;
		background-color: $page-bg !important;
		width: 100%;
	}

	.css-theme {
		// border: 2px solid;
		@include text-color();
		@include base-background();
		@include border-color();
		@include shadow-color();
	}
	
	
</style>